<%--
  Created by IntelliJ IDEA.
  User: FT
  Date: 2020/10/15
  Time: 18:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加</title>
    <script src="/js/jquery.js"></script>
    <script>
        $(function () {
            $("#add").click(function () {
                $.ajax({
                    url: "/student/jsonAdd",
                    type:"get",
                    data: $("#formText").serialize(),
                    dataType:"json",
                    success:function (data) {
                        alert(data);
                    }
                });
            });
        })
    </script>
</head>
<body>
<form action="/student/add" method="post">
    姓名：<input type="text" name="stuName"> <br><br>
    年龄：<input type="text" name="stuAge"><br><br>
    密码：<input type="text" name="stuPassword"><br><br>
    <input type="submit" value="注册">
</form>

<form id="formText" action="">
    姓名：<input type="text" name="stuName"> <br><br>
    年龄：<input type="text" name="stuAge"><br><br>
    密码：<input type="text" name="stuPassword"><br><br>
</form>
<button id="add">json提交</button>
</body>
</html>
